package chebu.GPS;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
	private static final String TAG = MainActivity.class.getSimpleName();
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.servicemenu, menu);
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
        case R.id.itemStart:
            //newGame();
        	Log.d(TAG,"Start ItemClickeado");
        	startService(new Intent(this,UpdateService.class));
        	
            return true;
        case R.id.itemStop:
            //showHelp();
        	Log.d(TAG,"Stop ItemClickeado");
        	stopService(new Intent(this,UpdateService.class));
            return true;           
        case R.id.itemVerMapa:
        	Log.d(TAG,"VerMapa ItemClickeado");

        	Intent myIntent = new Intent(MainActivity.this, gpsActivity.class);
        	MainActivity.this.startActivity(myIntent);
        	
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }
    
  
    
    
}